<div class="business-center-title">
	<h1>业务中心</h1>
	<div class="business-overview-date">
		<span class="business-big">{{today}}</span>
		<span class="business-small">最近60分钟</span>
	</div>
</div>

{{#if auth.isAdmin}}
<div class="business-overview-wrapper">
	<div class="business-overview-setwrap">
		<button class="pull-right business-overview-button-conmon-style" {{action "startAddApplication"}} title="添加">添加</button>
	</div>
</div>
{{/if}}
<div class="business-list-item-wrap" style="padding-top:60px;">
	{{#each model as |app|}}
	<div class="business-list-item">
		{{#link-to "business.detail" app.id class="business-list-item-link"}}{{app.name}}{{/link-to}}
		{{view view.Sequence
			id=app.viewName
			viewName=app.viewName
			class="business-center-sequence"
			appData=app
			data=app.performances
			itemClick="sequenceItemClick"}}
		
		<div class="business-list-item-xAxis">
		{{view view.Graduation
			sequenceId=app.viewName
			startTime=app.startXAxisTime
			class="business-list-item-graduation"
			endTime=app.endXAxisTime}}
		</div>

		{{#unless auth.isNormal}}
		<span class="business-item-operation">
			<div class="btn-group">
				<button class="btn" {{action "startEditApplication" app}} title="编辑"><i class="iconfont icon-wcunchu"></i></button>
				{{#unless administrators}}
					<button class="btn" {{action "deleteApplication" app}} title="删除"><i class="iconfont icon-lajixiang"></i></button>
				{{/unless}}
				<button class="btn btn-up" {{action "moveUpApplication" app}} title="上移"><i class="iconfont icon-shangsheng"></i></button>
				<button class="btn btn-down" {{action "moveDownApplication" app}} title="下移"><i class="iconfont icon-xiajiang"></i></button>
			</div>
		</span>
		{{/unless}}
	</div>
	{{else}}
	<div class="alert alert-info business-center-alert">没有应用, 请点击添加按钮添加</div>
	{{/each}}
</div>

{{#view view.Dialog
	id="businessApplicationAdd"
	title='添加业务系统'
	class="hide apm-dialog-wrap"
	autoOpen=false
	modal=true
	width=500
	buttons=dialogButtons}}
	<form class="form-horizontal" {{action "addApplication" on="submit"}}>
		<div {{bind-attr class=":alert businessAddformTip::hide"}}><strong>{{businessAddformTip}}</strong></div>
		<div class="control-group">
			<label class="control-label">名称:</label>
			<div class="controls">
				{{input class="input" name="name" value=applicationModel.name maxlength="20"}}
			</div>
		</div>
	</form>
{{/view}}

{{#view view.Dialog
	id="businessApplicationEdit"
	title='编辑业务系统'
	class="hide apm-dialog-wrap"
	autoOpen=false
	modal=true
	width=500
	buttons=dialogButtons}}
	<form class="form-horizontal" {{action "updateApplication" on="submit"}}>
		<div {{bind-attr class=":alert businessAddformTip::hide"}}><strong>{{businessAddformTip}}</strong></div>
		<div class="control-group">
			<div class="controls">
				{{input class="input" name="name" value=applicationModel.name maxlength="20"}}
			</div>
		</div>
	</form>
{{/view}}